var t = new(require("../../../utils/http").HTTP);
Page({
    data: {
        list: []
    },
    onShow: function () {
        var e = this,
        n = wx.getStorageSync("user");
        t.request({
            url: "https://www.qlsyyun.com:3000/attention/attention",
            data: {
                name: n[0]
            }
        }).then((function (t) {
                var n = t.data;
                0 == n.length ? wx.showToast({
                    title: "暂无关注",
                    icon: "none",
                    duration: 1e3,
                    success: function () {
                        setTimeout((function () {
                                // wx.navigateBack({
                                //     delta: 1
                                // })
                            }), 1e3)
                    }
                }) : e.setData({
                    list: n
                })
            }))
    },
    funExpertitem: function (t) {
        var e = t.currentTarget.dataset.bean.bID;
        wx.navigateTo({
            url: "/pages/intention/specifics/specifics?bID=" + e
        })
    },
    onOpen: function (t) {
        var e = t.detail,
        n = e.position,
        a = e.name;
        switch (n) {
        case "left":
            Notify({
                type: "primary",
                message: "".concat(a).concat(n, "部分展示open事件被触发")
            })
        }
    },
    delete : function (e) {
        var n = this,
        a = e.target.dataset.item,
        i = wx.getStorageSync("user");
        t.request({
            url: "https://www.qlsyyun.com:3000/allocation/unzscbgzlb",
            header: {
                "Content-Type": "application/x-www-form-urlencoded"
            },
            method: "POST",
            data: {
                bID: a.bID,
                qymc: a.qymc,
                zsy: i[0]
            }
        }).then((function (e) {
                wx.showToast({
                    title: "取消关注成功",
                    icon: "none",
                    duration: 1e3
                }),
                t.request({
                    url: "https://www.qlsyyun.com:3000/attention/attention",
                    data: {
                        name: i[0]
                    }
                }).then((function (t) {
                        var e = t.data;
                        0 == e.length && wx.navigateBack({
                            delta: 1
                        }),
                        n.setData({
                            list: e
                        })
                    }))
            }))
    }
});
